home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Technical Documentation / Sample Code / DTS.Lib & Samples / Kibitz / Start.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-22  |  1.7 KB  |  74 lines  |  [TEXT/MPS ]

  1. /*
  2. ** Apple Macintosh Developer Technical Support
  3. **
  4. ** File:             start.c
  5. ** Originally from:  Traffic Light 2.0 (2.0 version by Keith Rollin)
  6. ** Modified by:      Eric Soldan
  7. **
  8. ** Copyright © 1989-1992 Apple Computer, Inc.
  9. ** All rights reserved. */
  10.  
  11.  
  12.  
  13. /*****************************************************************************/
  14.  
  15.  
  16.  
  17. #include "Kibitz.h"                /* Get the Kibitz includes/typedefs, etc.    */
  18. #include "KibitzCommon.h"        /* Get the stuff in common with rez.        */
  19. #include "Kibitz.protos"        /* Get the prototypes for Kibitz.            */
  20.  
  21. #ifndef __TOOLUTILS__
  22. #include <ToolUtils.h>
  23. #endif
  24.  
  25.  
  26.  
  27. /*****************************************************************************/
  28.  
  29.  
  30.  
  31. extern void _DataInit();
  32.  
  33.  
  34.  
  35. /*****************************************************************************/
  36. /*****************************************************************************/
  37.  
  38.  
  39.  
  40. #pragma segment Main
  41. void    main(void)
  42. {
  43.     NamesTableEntry    appNTE;
  44.     EntityName        appEntityName;
  45.     OSErr            atErr;
  46.  
  47. #ifndef THINK_C
  48.     UnloadSeg((Ptr)_DataInit);        /* Note that _DataInit can't be in Main! */
  49. #endif
  50.     
  51.     SetApplLimit(GetApplLimit() - 16384);
  52.         /* This decreases the application heap by 16k, which in turn
  53.         ** increases the stack by 16k. */
  54.  
  55.     MaxApplZone();        /* Expand the heap so code segments load at the top. */
  56.     Initialize();                            /* Initialize the program. */
  57.  
  58.     DoSetCursor(*GetCursor(watchCursor));    /* Rest of startup may take a while. */
  59.  
  60.     StartDocuments();                /* Open (or print) designated documents. */
  61.     UnloadSeg((Ptr)Initialize);        /* Initialize can't be in Main! */
  62.  
  63.     atErr = AddPPCNBPAlias(&appNTE, "\pKibitz", &appEntityName);
  64.  
  65.     EventLoop();                /* Call the main event loop. */
  66.  
  67.     if (!atErr) RemoveNBPAlias(&appEntityName);
  68.  
  69.     ExitToShell();                    /* Quit the application. */
  70. }
  71.  
  72.  
  73.  
  74.